@extends('layouts.default')
@section('css')
    <link rel="stylesheet" href="{{asset('admin-lte/plugins/datatables/dataTables.bootstrap4.css')}}">
    {{--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">--}}
    {{--<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">--}}
@stop

@section('content')
    <div class="row">
        <div class="col-12">
            
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">Banner列表 / <a class="text-primary" href="{{url('admin/banner/create')}}">新增Banner</a></h3>
                </div>
                @include('layouts.message')
                <!-- /.card-header -->
                <div class="card-body">
                    <table id="example1" class="table table-bordered table-striped">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>标题</th>
                            <th>图片</th>
                            <th>跳转链接</th>
                            <th>图片排序</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach ($lists as $list)
                        <tr>
                            <td>{{ $list->id }}</td>
                            <td>{{ $list->title }}</td>
                            <td><img src="{{ $list->image }}" style="width: 100px!important;"></td>
                            <td><div style="width:200px;overflow: scroll">{{ $list->url }}</div></td>
                            <td>{{ $list->sort }}</td>
                            <td>{{ $list->created_at }}</td>
                            <td><a href="javascript:if(confirm('确认删除?')) location.href='{{url('admin/banner/destroy',[$list->id])}}';" class="btn btn-danger">删除</a><a href="{{url('admin/banner/edit',[$list->id])}}" class="btn btn-info">编辑</a></td>
                        </tr>
                        @endforeach
                        </tbody>
                        <tfoot>
                        <tr>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                        </tr>
                        </tfoot>
                    </table>

                </div>
                <!-- /.card-body -->
            </div>
            <!-- /.card -->
        </div>
        <!-- /.col -->
    </div>

@stop

@section('script')
    <script src="{{asset('admin-lte/plugins/datatables/jquery.dataTables.js')}}"></script>
    <script src="{{asset('admin-lte/plugins/datatables/dataTables.bootstrap4.js')}}"></script>
    <script>
        $(function () {
            $("#example1").DataTable({
                "language"  : {
                    url :'https://cdn.datatables.net/plug-ins/1.10.19/i18n/Chinese.json'
                },
            });

        });
    </script>
@stop